// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   SalaryPro.java

package com.oa.archives;

import com.oa.database.DataConn;
import com.oa.database.QueryData;
import java.sql.*;

public class SalaryPro extends QueryData
{

    public SalaryPro()
    {
    }

    public void makeSalaryTable(String tableName, String yMonth, String ckYm, String CJR, String CJRQ)
        throws Exception
    {
        ResultSet rs1 = null;
        ResultSet rs2 = null;
        String sqlStr1 = null;
        String sqlStr2 = null;
        String sqlStr3 = null;
        String sqlStr4 = null;
        PreparedStatement pstmt1 = null;
        PreparedStatement pstmt2 = null;
        PreparedStatement pstmt3 = null;
        PreparedStatement pstmt4 = null;
        DataConn dataConn1 = null;
        DataConn dataConn2 = null;
        DataConn dataConn3 = null;
        DataConn dataConn4 = null;
        int JBXXID = 0;
        int i = 0;
        try
        {
            dataConn1 = new DataConn();
            dataConn2 = new DataConn();
            dataConn3 = new DataConn();
            dataConn4 = new DataConn();
            sqlStr1 = "select JBXXID from OA_YG_JB where YGZT <> 3 and SCBJ =0";
            sqlStr2 = "select LBID, GZ from OA_YG_GZMX where JBXXID = ? and GZNY = ?";
            sqlStr3 = " insert into OA_YG_GZMX(GZNY,JBXXID,LBID,GZ) values(?,?,?,?)";
            pstmt1 = dataConn1.getConnection().prepareStatement(sqlStr1);
            pstmt2 = dataConn2.getConnection().prepareStatement(sqlStr2);
            pstmt3 = dataConn3.getConnection().prepareStatement(sqlStr3);
            for(rs1 = pstmt1.executeQuery(); rs1.next();)
                if(ckYm != null)
                {
                    JBXXID = rs1.getInt(1);
                    pstmt2.setInt(1, JBXXID);
                    pstmt2.setString(2, ckYm);
                    rs2 = pstmt2.executeQuery();
                    for(i = 0; rs2.next(); i++)
                    {
                        pstmt3.setString(1, yMonth);
                        pstmt3.setInt(2, JBXXID);
                        pstmt3.setInt(3, rs2.getInt(1));
                        pstmt3.setFloat(4, rs2.getFloat(2));
                        pstmt3.executeUpdate();
                    }

                }

        }
        catch(SQLException sqlexception) { }
        catch(Exception exception) { }
    }

    public static void main(String args[])
    {
        SalaryPro salaryPro1 = new SalaryPro();
    }
}
